package com.example.design.patterns.冰河.行为模式.观察者模式;

import com.example.design.patterns.冰河.行为模式.观察者模式.concreteObserver.HuangPuPoliceman;
import com.example.design.patterns.冰河.行为模式.观察者模式.concreteObserver.TianHePoliceman;
import com.example.design.patterns.冰河.行为模式.观察者模式.concreteSubject.HuangPuCitizen;
import com.example.design.patterns.冰河.行为模式.观察者模式.concreteSubject.TianHeCitizen;
import com.example.design.patterns.冰河.行为模式.观察者模式.subject.Citizen;

public class Test {
    public static void main(String[] args) {
        TianHePoliceman tianHePoliceman = new TianHePoliceman();
        HuangPuPoliceman huangPuPoliceman = new HuangPuPoliceman();

        Citizen citizen = new HuangPuCitizen(huangPuPoliceman);
        citizen.sendMessage("unnormal");
        citizen.sendMessage("normal");
        System.out.println("------------------");

        citizen = new TianHeCitizen(tianHePoliceman);
        citizen.sendMessage("unnormal");
        citizen.sendMessage("normal");
        System.out.println("------------------");

    }
}
